-- This shows how the version affects which code points that actually are defined.
-- © Erland Sommarskog 2024.
USE Latin1_General_CI_AS
go
-- We have again German for "extra large", but there is a mysterious macron
-- over the "ö". Run these statements, are the results the expected ones?
DECLARE @extralarge nvarchar(10) = N'Übergrȫße'
SELECT upper(@extralarge) AS Upper, 
       replace(@extralarge, N'ȫ', N'ö') AS Replace, 
       charindex(N'ȫ', @extralarge) AS Charindex,
       IIF (@extralarge = N'Übergrße', 'Equal', 'Not equal') IsEqual
-- The strange results are due that in a version-80 collation, this code point,
-- U+022B is not defined. We are lured by SSMS that shows a character because
-- it uses much later version of Unicode.
go
-- Create a database for a version-100 collation where this code point is 
-- defined, and move to it.
CREATE DATABASE Latin1_General_100_CI_AS COLLATE Latin1_General_100_CI_AS
go
USE Latin1_General_100_CI_AS
go
-- All results are now as expected.
DECLARE @extralarge nvarchar(10) = N'Übergrȫße'
SELECT upper(@extralarge) AS Upper, 
       replace(@extralarge, N'ȫ', N'ö') AS Replace, 
       charindex(N'ȫ', @extralarge) AS Charindex,
       IIF (@extralarge = N'Übergrße', 'Equal', 'Not equal') IsEqual
go
